<script setup lang="ts">
import { onBeforeMount } from 'vue';
import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();

onBeforeMount(() => {
  const { params, query } = route;
  const { path } = params as { path: string };
  router.replace({ path: '/' + path, query });
});

// Vue 3 不再需要 render 函数
// 因为 script setup 使用空的 template 即可实现相同效果
</script>

<template>
  <!-- 空模板 -->
</template>
